import request from '@/utils/request'

// 查询车主列表
export function listCarOwner(query) {
  return request({
    url: 'http://localhost:9999/getAllCarOwners',
    method: 'get',
    params: query
  })
}

// 获取车主详细信息
export function getCarOwner(ownerId) {
  return request({
    url: `http://localhost:9999/selectCarOwnerByIdv2/${ownerId}`,
    method: 'get'
  })
}

// 新增车主
export function addCarOwner(data) {
  return request({
    url: 'http://localhost:9999/insertCarOwner',
    method: 'post',
    data: data
  })
}

// 修改车主
export function updateCarOwner(data) {
  return request({
    url: 'http://localhost:9999/updateCarOwner',
    method: 'post',
    data: data
  })
}

// 删除车主
export function deleteCarOwner(ownerId) {
  return request({
    url: `http://localhost:9999/deleteCarOwner/${ownerId}`,
    method: 'get'
  })
}

// 批量删除车主
export function batchDeleteCarOwner(ownerIds) {
  return request({
    url: `http://localhost:9999/batchDeleteCarOwner/${ownerIds}`,
    method: 'get'
  })
} 